<!DOCTYPE html>
<html>
	<head> 
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
		<link rel="stylesheet" href="js/themes/default/easyui.css"/>
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>	
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<style>
		body{
			font-size:12px;
		}
		table,
		th,
		td {
			border: 1px solid grey;
			border-collapse: collapse;
			padding: 5px;
			vertical-align: middle !important;
		}		
		table td:nth-child(odd) {
			background-color: #f1f1f1;
			width:160px;
		}
		table td:nth-child(even) {
			width:160px;
		}
		table tr:nth-child(even) {
			background-color:#ffffff;
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:center;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
		img{
			margin:10px 2px 0;
			width:150px;
			/*height:150px;*/
			border-radius:5px;
			box-shadow:2px 3px 5px;
			transition:.5s all;
		}
		img:nth-child(1){
			margin-left:200px;
		}
		img:hover{
			transform:scale(4.2);
		}
	</style>
	<body>		
	<!--图片审核-->
		<div class="">
			<div id="sho"></div>
		<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">				
				<tbody>
					<tr>
						<th colspan="8">实名照片审核:</th>
					</tr>
					<tr>
						<td>真实姓名:</td>
						<td colspan="8">
							<input id="p0" class="form-control" type="text" style="width:280px"/>
						</td>								
					</tr>
					<tr>
						<td>手机号码:</td>
						<td colspan="8">
							<input id="p1" class="form-control" type="text" style="width:280px"/>
						</td>								
					</tr>
					<tr>
						<td>身份证号码:</td>
						<td colspan="8">
							<input id="p2" class="form-control" type="text" style="width:280px"/>
						</td>								
					</tr>
					<tr>
						<td>银行名称:</td>
						<td colspan="8">
							<input id="pp" class="form-control" type="text" style="width:280px"/>
						</td>								
					</tr>
					<tr>
						<td>银行卡号码:</td>
						<td colspan="8">
							<input id="p3" class="form-control" type="text" style="width:280px"/>
						</td>								
					</tr>
					<tr>
						<td colspan="8">
							<button class="btn btn-danger" id="btn" style="display:block;margin:0 auto">查询</button>
						</td>								
					</tr>
					<tr>
						<td colspan="4" rowspan="2">
							<img id="m1" src=""/>						
							<img id="m2" src=""/>												
							<img id="m3" src=""/>
						</td>
						<td colspan="4" class="text-center">
							审核
						</td>
					</tr>
					<tr>
						<td style="background:#fff;">
							<button id="btn0" class="btn btn-danger" style="display:block;margin:30px auto;">通过</button>
						</td>
						<td>
							<button id="btn1" class="btn btn-danger" style="display:block;margin:30px auto">拒绝</button>
						</td>
					</tr>
				</tbody>
			</table>		
		</div>
		<div style="height:500px;"></div>
		</div>
	</body>
	<script>
		$(function(){
			$('#btn').click(function(){
			
				var p1 = $('#p1').val();				
				if(p1!=""){
					$.ajax({
						type:"POST",
						url:window.baseUrl+"user/download/realname",
						async:true,
	        			data:{
	        				phone:p1,
	        			},
	        			dataType:"json",
	        			success:function(data){
	        				console.log(data)
	        				alert(data.resp_message)
	        				$('#m1').attr('src',data.result[0])
	        				$('#m2').attr('src',data.result[1])
	        				$('#m3').attr('src',data.result[2])       				
	        			},
	        			error:function(data){
	        				alert('没有图像数据，请先在手机上完善实名信息！')
	        				console.log("调用失败！")
	        				console.log(data)
	        			}
				});
				}else{
					alert('请输入查询手机号码！')
				}				
			
			})
					
			$('#btn0').click(function(){
				var xm = sessionStorage.getItem(key=23);
				var p1 = $('#p1').val();
				/*console.log(phone)*/
				var status = "1";
				$.ajax({
					type:"POST",
					url:window.baseUrl+"user/updatestatus/status",
					async:true,
        			data:{
        				phone:p1,
        				status:status,
        			},
        			dataType:"json",
        			success:function(data){
        				alert("恭喜用户【"+xm+"】通过实名审核！")
        				window.location.href="06.html"	
        			},
        			error:function(data){
        				alert("网络错误！")
        				console.log(data)	
        			}
				})
			})
			$('#btn1').click(function(){
				var xm = sessionStorage.getItem(key=23);
				var p1 = $('#p1').val();
				/*console.log(phone)*/
				var status = "2";
				$.ajax({
					type:"POST",
					url:window.baseUrl+"user/updatestatus/status",
					async:true,
        			data:{
        				phone:p1,
        				status:status,
        			},
        			dataType:"json",
        			success:function(data){
        				alert("用户【"+xm+"】实名审核失败！")
        				console.log(data)	
        			},
        			error:function(data){
        				alert("网络错误！")
        				console.log(data)	
        			}
				})				
			})
		})
	</script>
</html>




